package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum AccessModeEnum {
    ACCESSED("ACCESSED"), // 访问我的
    VISITED("VISITED"); // 我访问的

    private final String code;

    AccessModeEnum(String code){
        this.code = code;
    }

    public static AccessModeEnum byCode(String code) {
        for (AccessModeEnum e: AccessModeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
    public static boolean isAccessed(String code){
        return ACCESSED.getCode().equalsIgnoreCase(code);
    }
    public static boolean isVisited(String code){
        return VISITED.getCode().equalsIgnoreCase(code);
    }
}
